package com.onLineCar;

import com.onLineCar.common.core.domain.Result;
import com.onLineCar.impl.DriverFeignImpl;
import com.onLineCar.vehicle.entity.TblOrder;
import com.onLineCar.vehicle.entity.request.RequestUpdate;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.constraints.NotBlank;

/**
 * @Author The future is full of hope
 * @CreateTime 2023/12/17 0017 20:48
 * @PackageName:com.onLineCar
 * @ClassName: deign
 */


@FeignClient(name = "onLineCar-vehice",fallback = DriverFeignImpl.class)
public interface DriverFeign {


    @GetMapping("/tbl-order/selectOrderByNumber/{orderNumber}")
    public Result<TblOrder> selectOrderByNumber(@NotBlank @PathVariable("orderNumber") String orderNumber);

    @PostMapping("/tbl-order/updateOrderStateByOrderNumber")
    public Result updateOrderStateByOrderNumber(@RequestBody RequestUpdate requestUpdate);


    @PostMapping ("/tbl-order/updateUserReach")
    @Transactional
    public Result updateUserReach(@RequestBody RequestUpdate requestUpdate);


}
